{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "21c0fff9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "9d1d145e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'13</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>2785</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'16</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11</td>\n",
       "      <td>7</td>\n",
       "      <td>3133</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'09</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>3901</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'21</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>4946</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3'44</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13</td>\n",
       "      <td>9</td>\n",
       "      <td>3538</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4'23</td>\n",
       "      <td>8.27</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>4647</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>473</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5'19</td>\n",
       "      <td>9.55</td>\n",
       "      <td>210.0</td>\n",
       "      <td>15</td>\n",
       "      <td>6</td>\n",
       "      <td>7042</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>474</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3'25</td>\n",
       "      <td>7.50</td>\n",
       "      <td>252.0</td>\n",
       "      <td>13</td>\n",
       "      <td>13</td>\n",
       "      <td>5755</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4'39</td>\n",
       "      <td>7.81</td>\n",
       "      <td>208.0</td>\n",
       "      <td>14</td>\n",
       "      <td>11</td>\n",
       "      <td>5688</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>477 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别 男1000米跑  男50米跑    男跳远  男体前屈  男引体  男肺活量     身高    体重  BMI\n",
       "0     1  男    4'13   8.88  195.0    12    1  2785  170.0  72.6    0\n",
       "1     1  男    4'16   7.70  225.0    11    7  3133  174.0  52.7    0\n",
       "2     1  男    4'09   8.45  218.0    14    1  3901  169.0  46.5    0\n",
       "3     1  男    4'21   8.05  206.0    13    1  4946  183.0  79.7    0\n",
       "4     1  男    3'44   7.52  210.0    13    9  3538  171.0  54.7    0\n",
       "..   .. ..     ...    ...    ...   ...  ...   ...    ...   ...  ...\n",
       "472  17  男    4'23   8.27  208.0    10    0  4647  176.0  69.5    0\n",
       "473  17  男    5'19   9.55  210.0    15    6  7042  177.0  76.0    0\n",
       "474  17  男    3'25   7.50  252.0    13   13  5755  181.0  65.0    0\n",
       "475  17  男    4'39   7.81  208.0    14   11  5688  172.0  51.7    0\n",
       "476  17  男       0   0.00    0.0     0    0     0    0.0   0.0    0\n",
       "\n",
       "[477 rows x 11 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1 = pd.read_excel('../data/18级高一体测成绩汇总.xls') #默认加载第一个工作表\n",
    "df1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7dceeb85",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">男肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男体前屈</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女跳远</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男引体</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女仰卧</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男1000米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女800米跑</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>...</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>100</td>\n",
       "      <td>3'24\"</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3'35\"</td>\n",
       "      <td>95</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3'40\"</td>\n",
       "      <td>90</td>\n",
       "      <td>3'36\"</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3'47\"</td>\n",
       "      <td>85</td>\n",
       "      <td>3'43\"</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>80</td>\n",
       "      <td>3'50\"</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3680</td>\n",
       "      <td>78</td>\n",
       "      <td>2650</td>\n",
       "      <td>78</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78</td>\n",
       "      <td>8.8</td>\n",
       "      <td>78</td>\n",
       "      <td>13.6</td>\n",
       "      <td>78</td>\n",
       "      <td>...</td>\n",
       "      <td>175</td>\n",
       "      <td>78</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>4'00\"</td>\n",
       "      <td>78</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3560</td>\n",
       "      <td>76</td>\n",
       "      <td>2550</td>\n",
       "      <td>76</td>\n",
       "      <td>7.9</td>\n",
       "      <td>76</td>\n",
       "      <td>9.0</td>\n",
       "      <td>76</td>\n",
       "      <td>12.2</td>\n",
       "      <td>76</td>\n",
       "      <td>...</td>\n",
       "      <td>172</td>\n",
       "      <td>76</td>\n",
       "      <td>11.0</td>\n",
       "      <td>76</td>\n",
       "      <td>39</td>\n",
       "      <td>76</td>\n",
       "      <td>4'05\"</td>\n",
       "      <td>76</td>\n",
       "      <td>4'00\"</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>3440</td>\n",
       "      <td>74</td>\n",
       "      <td>2450</td>\n",
       "      <td>74</td>\n",
       "      <td>8.1</td>\n",
       "      <td>74</td>\n",
       "      <td>9.2</td>\n",
       "      <td>74</td>\n",
       "      <td>10.8</td>\n",
       "      <td>74</td>\n",
       "      <td>...</td>\n",
       "      <td>169</td>\n",
       "      <td>74</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74</td>\n",
       "      <td>37</td>\n",
       "      <td>74</td>\n",
       "      <td>4'10\"</td>\n",
       "      <td>74</td>\n",
       "      <td>4'05\"</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3320</td>\n",
       "      <td>72</td>\n",
       "      <td>2350</td>\n",
       "      <td>72</td>\n",
       "      <td>8.3</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>...</td>\n",
       "      <td>166</td>\n",
       "      <td>72</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>4'15\"</td>\n",
       "      <td>72</td>\n",
       "      <td>4'10\"</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3200</td>\n",
       "      <td>70</td>\n",
       "      <td>2250</td>\n",
       "      <td>70</td>\n",
       "      <td>8.5</td>\n",
       "      <td>70</td>\n",
       "      <td>9.6</td>\n",
       "      <td>70</td>\n",
       "      <td>8.0</td>\n",
       "      <td>70</td>\n",
       "      <td>...</td>\n",
       "      <td>163</td>\n",
       "      <td>70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70</td>\n",
       "      <td>33</td>\n",
       "      <td>70</td>\n",
       "      <td>4'20\"</td>\n",
       "      <td>70</td>\n",
       "      <td>4'15\"</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3080</td>\n",
       "      <td>68</td>\n",
       "      <td>2150</td>\n",
       "      <td>68</td>\n",
       "      <td>8.7</td>\n",
       "      <td>68</td>\n",
       "      <td>9.8</td>\n",
       "      <td>68</td>\n",
       "      <td>6.6</td>\n",
       "      <td>68</td>\n",
       "      <td>...</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>9.0</td>\n",
       "      <td>68</td>\n",
       "      <td>31</td>\n",
       "      <td>68</td>\n",
       "      <td>4'25\"</td>\n",
       "      <td>68</td>\n",
       "      <td>4'20\"</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2960</td>\n",
       "      <td>66</td>\n",
       "      <td>2050</td>\n",
       "      <td>66</td>\n",
       "      <td>8.9</td>\n",
       "      <td>66</td>\n",
       "      <td>10.0</td>\n",
       "      <td>66</td>\n",
       "      <td>5.2</td>\n",
       "      <td>66</td>\n",
       "      <td>...</td>\n",
       "      <td>157</td>\n",
       "      <td>66</td>\n",
       "      <td>NaN</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>4'30\"</td>\n",
       "      <td>66</td>\n",
       "      <td>4'25\"</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2840</td>\n",
       "      <td>64</td>\n",
       "      <td>1950</td>\n",
       "      <td>64</td>\n",
       "      <td>9.1</td>\n",
       "      <td>64</td>\n",
       "      <td>10.2</td>\n",
       "      <td>64</td>\n",
       "      <td>3.8</td>\n",
       "      <td>64</td>\n",
       "      <td>...</td>\n",
       "      <td>154</td>\n",
       "      <td>64</td>\n",
       "      <td>8.0</td>\n",
       "      <td>64</td>\n",
       "      <td>27</td>\n",
       "      <td>64</td>\n",
       "      <td>4'35\"</td>\n",
       "      <td>64</td>\n",
       "      <td>4'30\"</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2720</td>\n",
       "      <td>62</td>\n",
       "      <td>1850</td>\n",
       "      <td>62</td>\n",
       "      <td>9.3</td>\n",
       "      <td>62</td>\n",
       "      <td>10.4</td>\n",
       "      <td>62</td>\n",
       "      <td>2.4</td>\n",
       "      <td>62</td>\n",
       "      <td>...</td>\n",
       "      <td>151</td>\n",
       "      <td>62</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62</td>\n",
       "      <td>25</td>\n",
       "      <td>62</td>\n",
       "      <td>4'40\"</td>\n",
       "      <td>62</td>\n",
       "      <td>4'35\"</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2600</td>\n",
       "      <td>60</td>\n",
       "      <td>1750</td>\n",
       "      <td>60</td>\n",
       "      <td>9.5</td>\n",
       "      <td>60</td>\n",
       "      <td>10.6</td>\n",
       "      <td>60</td>\n",
       "      <td>1.0</td>\n",
       "      <td>60</td>\n",
       "      <td>...</td>\n",
       "      <td>148</td>\n",
       "      <td>60</td>\n",
       "      <td>7.0</td>\n",
       "      <td>60</td>\n",
       "      <td>23</td>\n",
       "      <td>60</td>\n",
       "      <td>4'45\"</td>\n",
       "      <td>60</td>\n",
       "      <td>4'40\"</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2470</td>\n",
       "      <td>50</td>\n",
       "      <td>1710</td>\n",
       "      <td>50</td>\n",
       "      <td>9.7</td>\n",
       "      <td>50</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>50</td>\n",
       "      <td>...</td>\n",
       "      <td>143</td>\n",
       "      <td>50</td>\n",
       "      <td>6.0</td>\n",
       "      <td>50</td>\n",
       "      <td>21</td>\n",
       "      <td>50</td>\n",
       "      <td>5'05\"</td>\n",
       "      <td>50</td>\n",
       "      <td>4'50\"</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2340</td>\n",
       "      <td>40</td>\n",
       "      <td>1670</td>\n",
       "      <td>40</td>\n",
       "      <td>9.9</td>\n",
       "      <td>40</td>\n",
       "      <td>11.0</td>\n",
       "      <td>40</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>40</td>\n",
       "      <td>...</td>\n",
       "      <td>138</td>\n",
       "      <td>40</td>\n",
       "      <td>5.0</td>\n",
       "      <td>40</td>\n",
       "      <td>19</td>\n",
       "      <td>40</td>\n",
       "      <td>5'25\"</td>\n",
       "      <td>40</td>\n",
       "      <td>5'00\"</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2210</td>\n",
       "      <td>30</td>\n",
       "      <td>1630</td>\n",
       "      <td>30</td>\n",
       "      <td>10.1</td>\n",
       "      <td>30</td>\n",
       "      <td>11.2</td>\n",
       "      <td>30</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>30</td>\n",
       "      <td>...</td>\n",
       "      <td>133</td>\n",
       "      <td>30</td>\n",
       "      <td>4.0</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>30</td>\n",
       "      <td>5'45\"</td>\n",
       "      <td>30</td>\n",
       "      <td>5'10\"</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2080</td>\n",
       "      <td>20</td>\n",
       "      <td>1590</td>\n",
       "      <td>20</td>\n",
       "      <td>10.3</td>\n",
       "      <td>20</td>\n",
       "      <td>11.4</td>\n",
       "      <td>20</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>...</td>\n",
       "      <td>128</td>\n",
       "      <td>20</td>\n",
       "      <td>3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>15</td>\n",
       "      <td>20</td>\n",
       "      <td>6'05\"</td>\n",
       "      <td>20</td>\n",
       "      <td>5'20\"</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1950</td>\n",
       "      <td>10</td>\n",
       "      <td>1550</td>\n",
       "      <td>10</td>\n",
       "      <td>10.5</td>\n",
       "      <td>10</td>\n",
       "      <td>11.6</td>\n",
       "      <td>10</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>10</td>\n",
       "      <td>...</td>\n",
       "      <td>123</td>\n",
       "      <td>10</td>\n",
       "      <td>2.0</td>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>10</td>\n",
       "      <td>6'25\"</td>\n",
       "      <td>10</td>\n",
       "      <td>5'30\"</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    男肺活量       女肺活量      男50米跑      女50米跑       男体前屈       ...  女跳远       \\\n",
       "      成绩   分数    成绩   分数    成绩   分数    成绩   分数    成绩   分数  ...   成绩   分数   \n",
       "0   4540  100  3150  100   7.1  100   7.8  100  23.6  100  ...  204  100   \n",
       "1   4420   95  3100   95   7.2   95   7.9   95  21.5   95  ...  198   95   \n",
       "2   4300   90  3050   90   7.3   90   8.0   90  19.4   90  ...  192   90   \n",
       "3   4050   85  2900   85   7.4   85   8.3   85  17.2   85  ...  185   85   \n",
       "4   3800   80  2750   80   7.5   80   8.6   80  15.0   80  ...  178   80   \n",
       "5   3680   78  2650   78   7.7   78   8.8   78  13.6   78  ...  175   78   \n",
       "6   3560   76  2550   76   7.9   76   9.0   76  12.2   76  ...  172   76   \n",
       "7   3440   74  2450   74   8.1   74   9.2   74  10.8   74  ...  169   74   \n",
       "8   3320   72  2350   72   8.3   72   9.4   72   9.4   72  ...  166   72   \n",
       "9   3200   70  2250   70   8.5   70   9.6   70   8.0   70  ...  163   70   \n",
       "10  3080   68  2150   68   8.7   68   9.8   68   6.6   68  ...  160   68   \n",
       "11  2960   66  2050   66   8.9   66  10.0   66   5.2   66  ...  157   66   \n",
       "12  2840   64  1950   64   9.1   64  10.2   64   3.8   64  ...  154   64   \n",
       "13  2720   62  1850   62   9.3   62  10.4   62   2.4   62  ...  151   62   \n",
       "14  2600   60  1750   60   9.5   60  10.6   60   1.0   60  ...  148   60   \n",
       "15  2470   50  1710   50   9.7   50  10.8   50   0.0   50  ...  143   50   \n",
       "16  2340   40  1670   40   9.9   40  11.0   40  -1.0   40  ...  138   40   \n",
       "17  2210   30  1630   30  10.1   30  11.2   30  -2.0   30  ...  133   30   \n",
       "18  2080   20  1590   20  10.3   20  11.4   20  -3.0   20  ...  128   20   \n",
       "19  1950   10  1550   10  10.5   10  11.6   10  -4.0   10  ...  123   10   \n",
       "\n",
       "     男引体      女仰卧      男1000米跑      女800米跑       \n",
       "      成绩   分数  成绩   分数      成绩   分数     成绩   分数  \n",
       "0   16.0  100  53  100   3'30\"  100  3'24\"  100  \n",
       "1   15.0   95  51   95   3'35\"   95  3'30\"   95  \n",
       "2   14.0   90  49   90   3'40\"   90  3'36\"   90  \n",
       "3   13.0   85  46   85   3'47\"   85  3'43\"   85  \n",
       "4   12.0   80  43   80   3'55\"   80  3'50\"   80  \n",
       "5    NaN   78  41   78   4'00\"   78  3'55\"   78  \n",
       "6   11.0   76  39   76   4'05\"   76  4'00\"   76  \n",
       "7    NaN   74  37   74   4'10\"   74  4'05\"   74  \n",
       "8   10.0   72  35   72   4'15\"   72  4'10\"   72  \n",
       "9    NaN   70  33   70   4'20\"   70  4'15\"   70  \n",
       "10   9.0   68  31   68   4'25\"   68  4'20\"   68  \n",
       "11   NaN   66  29   66   4'30\"   66  4'25\"   66  \n",
       "12   8.0   64  27   64   4'35\"   64  4'30\"   64  \n",
       "13   NaN   62  25   62   4'40\"   62  4'35\"   62  \n",
       "14   7.0   60  23   60   4'45\"   60  4'40\"   60  \n",
       "15   6.0   50  21   50   5'05\"   50  4'50\"   50  \n",
       "16   5.0   40  19   40   5'25\"   40  5'00\"   40  \n",
       "17   4.0   30  17   30   5'45\"   30  5'10\"   30  \n",
       "18   3.0   20  15   20   6'05\"   20  5'20\"   20  \n",
       "19   2.0   10  13   10   6'25\"   10  5'30\"   10  \n",
       "\n",
       "[20 rows x 24 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 评分标准加载，\n",
    "df_score =pd.read_excel('../data/体侧成绩评分表.xls',header = [0,1])   #，header=[0,1]表示多层列索引\n",
    "df_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "9871388b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>9.60</td>\n",
       "      <td>150.0</td>\n",
       "      <td>24</td>\n",
       "      <td>41</td>\n",
       "      <td>2255</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.00</td>\n",
       "      <td>10.18</td>\n",
       "      <td>150.0</td>\n",
       "      <td>13</td>\n",
       "      <td>36</td>\n",
       "      <td>2937</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>10.18</td>\n",
       "      <td>152.0</td>\n",
       "      <td>15</td>\n",
       "      <td>35</td>\n",
       "      <td>2592</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.01</td>\n",
       "      <td>9.67</td>\n",
       "      <td>165.0</td>\n",
       "      <td>10</td>\n",
       "      <td>41</td>\n",
       "      <td>1829</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.48</td>\n",
       "      <td>9.09</td>\n",
       "      <td>180.0</td>\n",
       "      <td>10</td>\n",
       "      <td>46</td>\n",
       "      <td>2962</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重  BMI\n",
       "0     1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3    0\n",
       "1     1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6    0\n",
       "2     1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0    0\n",
       "3     1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7    0\n",
       "4     1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9    0\n",
       "..   .. ..     ...    ...    ...   ...  ...   ...    ...   ...  ...\n",
       "588  17  女    3.51   9.60  150.0    24   41  2255  158.0  49.0    0\n",
       "589  17  女    4.00  10.18  150.0    13   36  2937  161.0  55.7    0\n",
       "590  17  女    3.45  10.18  152.0    15   35  2592  165.0  48.6    0\n",
       "591  17  女    4.01   9.67  165.0    10   41  1829  154.0  43.6    0\n",
       "592  17  女    4.48   9.09  180.0    10   46  2962  162.0  55.3    0\n",
       "\n",
       "[593 rows x 11 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = pd.read_excel('../data/18级高一体测成绩汇总.xls',sheet_name = 1)  #指定加载第二个工作表\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "f737abd9",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "Can only use .str accessor with string values!",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-11-1f4b3b4581e1>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      9\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0ma\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mb\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m100\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     10\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 11\u001b[1;33m \u001b[0mdf1\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'男1000米跑'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdf1\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'男1000米跑'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstr\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mextract\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mr'(\\d+)\\'(\\d+)'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapplymap\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mlambda\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m:\u001b[0m\u001b[0mfloat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mlambda\u001b[0m \u001b[0mrow\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mmy_test\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mrow\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mrow\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32md:\\anaconda3\\envs\\tensorflow_env\\lib\\site-packages\\pandas\\core\\generic.py\u001b[0m in \u001b[0;36m__getattr__\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m   5268\u001b[0m             \u001b[1;32mor\u001b[0m \u001b[0mname\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessors\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   5269\u001b[0m         ):\n\u001b[1;32m-> 5270\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   5271\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   5272\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32md:\\anaconda3\\envs\\tensorflow_env\\lib\\site-packages\\pandas\\core\\accessor.py\u001b[0m in \u001b[0;36m__get__\u001b[1;34m(self, obj, cls)\u001b[0m\n\u001b[0;32m    185\u001b[0m             \u001b[1;31m# we're accessing the attribute of the class, i.e., Dataset.geo\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    186\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessor\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 187\u001b[1;33m         \u001b[0maccessor_obj\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_accessor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    188\u001b[0m         \u001b[1;31m# Replace the property with the accessor object. Inspired by:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    189\u001b[0m         \u001b[1;31m# http://www.pydanny.com/cached-property.html\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32md:\\anaconda3\\envs\\tensorflow_env\\lib\\site-packages\\pandas\\core\\strings.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, data)\u001b[0m\n\u001b[0;32m   2039\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2040\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2041\u001b[1;33m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_inferred_dtype\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_validate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2042\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_is_categorical\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mis_categorical_dtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2043\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_is_string\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"string\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32md:\\anaconda3\\envs\\tensorflow_env\\lib\\site-packages\\pandas\\core\\strings.py\u001b[0m in \u001b[0;36m_validate\u001b[1;34m(data)\u001b[0m\n\u001b[0;32m   2096\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2097\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0minferred_dtype\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mallowed_types\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2098\u001b[1;33m             \u001b[1;32mraise\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Can only use .str accessor with string values!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   2099\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0minferred_dtype\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2100\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mAttributeError\u001b[0m: Can only use .str accessor with string values!"
     ]
    }
   ],
   "source": [
    "# 男1000米跑，数据类型是str，并且是4’26这种形式，需要变成float类型的值\n",
    "# job[\"salary\"].str.lower()\\\n",
    "# .str.extract(r'(\\d+)[k]-(\\d+)k')\\\n",
    "# .applymap(lambda x:int(x))\\\n",
    "# .mean(axis=1)\n",
    "# def convert(x):\n",
    "#     x.\n",
    "def my_test(a, b):\n",
    "    return a + b/100\n",
    "    \n",
    "df1['男1000米跑']=df1['男1000米跑'].str.extract(r'(\\d+)\\'(\\d+)').applymap(lambda x:float(x)).apply(lambda row: my_test(row[0], row[1]), axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "a4f6530a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      4.13\n",
       "1      4.16\n",
       "2      4.09\n",
       "3      4.21\n",
       "4      3.44\n",
       "       ... \n",
       "472    4.23\n",
       "473    5.19\n",
       "474    3.25\n",
       "475    4.39\n",
       "476     NaN\n",
       "Name: 男1000米跑, Length: 477, dtype: float64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1['男1000米跑']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "88b26297",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>index</th>\n",
       "      <th>男肺活量成绩</th>\n",
       "      <th>男肺活量分数</th>\n",
       "      <th>女肺活量成绩</th>\n",
       "      <th>女肺活量分数</th>\n",
       "      <th>男50米跑成绩</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>女50米跑成绩</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>男体前屈成绩</th>\n",
       "      <th>...</th>\n",
       "      <th>女跳远成绩</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>男引体成绩</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>女仰卧成绩</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>女800米跑成绩</th>\n",
       "      <th>女800米跑分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>100</td>\n",
       "      <td>3'24\"</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3'35\"</td>\n",
       "      <td>95</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3'40\"</td>\n",
       "      <td>90</td>\n",
       "      <td>3'36\"</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3'47\"</td>\n",
       "      <td>85</td>\n",
       "      <td>3'43\"</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>80</td>\n",
       "      <td>3'50\"</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5</td>\n",
       "      <td>3680</td>\n",
       "      <td>78</td>\n",
       "      <td>2650</td>\n",
       "      <td>78</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78</td>\n",
       "      <td>8.8</td>\n",
       "      <td>78</td>\n",
       "      <td>13.6</td>\n",
       "      <td>...</td>\n",
       "      <td>175</td>\n",
       "      <td>78</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>4'00\"</td>\n",
       "      <td>78</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>6</td>\n",
       "      <td>3560</td>\n",
       "      <td>76</td>\n",
       "      <td>2550</td>\n",
       "      <td>76</td>\n",
       "      <td>7.9</td>\n",
       "      <td>76</td>\n",
       "      <td>9.0</td>\n",
       "      <td>76</td>\n",
       "      <td>12.2</td>\n",
       "      <td>...</td>\n",
       "      <td>172</td>\n",
       "      <td>76</td>\n",
       "      <td>11.0</td>\n",
       "      <td>76</td>\n",
       "      <td>39</td>\n",
       "      <td>76</td>\n",
       "      <td>4'05\"</td>\n",
       "      <td>76</td>\n",
       "      <td>4'00\"</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>7</td>\n",
       "      <td>3440</td>\n",
       "      <td>74</td>\n",
       "      <td>2450</td>\n",
       "      <td>74</td>\n",
       "      <td>8.1</td>\n",
       "      <td>74</td>\n",
       "      <td>9.2</td>\n",
       "      <td>74</td>\n",
       "      <td>10.8</td>\n",
       "      <td>...</td>\n",
       "      <td>169</td>\n",
       "      <td>74</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74</td>\n",
       "      <td>37</td>\n",
       "      <td>74</td>\n",
       "      <td>4'10\"</td>\n",
       "      <td>74</td>\n",
       "      <td>4'05\"</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>8</td>\n",
       "      <td>3320</td>\n",
       "      <td>72</td>\n",
       "      <td>2350</td>\n",
       "      <td>72</td>\n",
       "      <td>8.3</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>...</td>\n",
       "      <td>166</td>\n",
       "      <td>72</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>4'15\"</td>\n",
       "      <td>72</td>\n",
       "      <td>4'10\"</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9</td>\n",
       "      <td>3200</td>\n",
       "      <td>70</td>\n",
       "      <td>2250</td>\n",
       "      <td>70</td>\n",
       "      <td>8.5</td>\n",
       "      <td>70</td>\n",
       "      <td>9.6</td>\n",
       "      <td>70</td>\n",
       "      <td>8.0</td>\n",
       "      <td>...</td>\n",
       "      <td>163</td>\n",
       "      <td>70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70</td>\n",
       "      <td>33</td>\n",
       "      <td>70</td>\n",
       "      <td>4'20\"</td>\n",
       "      <td>70</td>\n",
       "      <td>4'15\"</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10</td>\n",
       "      <td>3080</td>\n",
       "      <td>68</td>\n",
       "      <td>2150</td>\n",
       "      <td>68</td>\n",
       "      <td>8.7</td>\n",
       "      <td>68</td>\n",
       "      <td>9.8</td>\n",
       "      <td>68</td>\n",
       "      <td>6.6</td>\n",
       "      <td>...</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>9.0</td>\n",
       "      <td>68</td>\n",
       "      <td>31</td>\n",
       "      <td>68</td>\n",
       "      <td>4'25\"</td>\n",
       "      <td>68</td>\n",
       "      <td>4'20\"</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>11</td>\n",
       "      <td>2960</td>\n",
       "      <td>66</td>\n",
       "      <td>2050</td>\n",
       "      <td>66</td>\n",
       "      <td>8.9</td>\n",
       "      <td>66</td>\n",
       "      <td>10.0</td>\n",
       "      <td>66</td>\n",
       "      <td>5.2</td>\n",
       "      <td>...</td>\n",
       "      <td>157</td>\n",
       "      <td>66</td>\n",
       "      <td>NaN</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>4'30\"</td>\n",
       "      <td>66</td>\n",
       "      <td>4'25\"</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>12</td>\n",
       "      <td>2840</td>\n",
       "      <td>64</td>\n",
       "      <td>1950</td>\n",
       "      <td>64</td>\n",
       "      <td>9.1</td>\n",
       "      <td>64</td>\n",
       "      <td>10.2</td>\n",
       "      <td>64</td>\n",
       "      <td>3.8</td>\n",
       "      <td>...</td>\n",
       "      <td>154</td>\n",
       "      <td>64</td>\n",
       "      <td>8.0</td>\n",
       "      <td>64</td>\n",
       "      <td>27</td>\n",
       "      <td>64</td>\n",
       "      <td>4'35\"</td>\n",
       "      <td>64</td>\n",
       "      <td>4'30\"</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>13</td>\n",
       "      <td>2720</td>\n",
       "      <td>62</td>\n",
       "      <td>1850</td>\n",
       "      <td>62</td>\n",
       "      <td>9.3</td>\n",
       "      <td>62</td>\n",
       "      <td>10.4</td>\n",
       "      <td>62</td>\n",
       "      <td>2.4</td>\n",
       "      <td>...</td>\n",
       "      <td>151</td>\n",
       "      <td>62</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62</td>\n",
       "      <td>25</td>\n",
       "      <td>62</td>\n",
       "      <td>4'40\"</td>\n",
       "      <td>62</td>\n",
       "      <td>4'35\"</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>14</td>\n",
       "      <td>2600</td>\n",
       "      <td>60</td>\n",
       "      <td>1750</td>\n",
       "      <td>60</td>\n",
       "      <td>9.5</td>\n",
       "      <td>60</td>\n",
       "      <td>10.6</td>\n",
       "      <td>60</td>\n",
       "      <td>1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>148</td>\n",
       "      <td>60</td>\n",
       "      <td>7.0</td>\n",
       "      <td>60</td>\n",
       "      <td>23</td>\n",
       "      <td>60</td>\n",
       "      <td>4'45\"</td>\n",
       "      <td>60</td>\n",
       "      <td>4'40\"</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>15</td>\n",
       "      <td>2470</td>\n",
       "      <td>50</td>\n",
       "      <td>1710</td>\n",
       "      <td>50</td>\n",
       "      <td>9.7</td>\n",
       "      <td>50</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>143</td>\n",
       "      <td>50</td>\n",
       "      <td>6.0</td>\n",
       "      <td>50</td>\n",
       "      <td>21</td>\n",
       "      <td>50</td>\n",
       "      <td>5'05\"</td>\n",
       "      <td>50</td>\n",
       "      <td>4'50\"</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>16</td>\n",
       "      <td>2340</td>\n",
       "      <td>40</td>\n",
       "      <td>1670</td>\n",
       "      <td>40</td>\n",
       "      <td>9.9</td>\n",
       "      <td>40</td>\n",
       "      <td>11.0</td>\n",
       "      <td>40</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>...</td>\n",
       "      <td>138</td>\n",
       "      <td>40</td>\n",
       "      <td>5.0</td>\n",
       "      <td>40</td>\n",
       "      <td>19</td>\n",
       "      <td>40</td>\n",
       "      <td>5'25\"</td>\n",
       "      <td>40</td>\n",
       "      <td>5'00\"</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>17</td>\n",
       "      <td>2210</td>\n",
       "      <td>30</td>\n",
       "      <td>1630</td>\n",
       "      <td>30</td>\n",
       "      <td>10.1</td>\n",
       "      <td>30</td>\n",
       "      <td>11.2</td>\n",
       "      <td>30</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>...</td>\n",
       "      <td>133</td>\n",
       "      <td>30</td>\n",
       "      <td>4.0</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>30</td>\n",
       "      <td>5'45\"</td>\n",
       "      <td>30</td>\n",
       "      <td>5'10\"</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>18</td>\n",
       "      <td>2080</td>\n",
       "      <td>20</td>\n",
       "      <td>1590</td>\n",
       "      <td>20</td>\n",
       "      <td>10.3</td>\n",
       "      <td>20</td>\n",
       "      <td>11.4</td>\n",
       "      <td>20</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>...</td>\n",
       "      <td>128</td>\n",
       "      <td>20</td>\n",
       "      <td>3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>15</td>\n",
       "      <td>20</td>\n",
       "      <td>6'05\"</td>\n",
       "      <td>20</td>\n",
       "      <td>5'20\"</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>19</td>\n",
       "      <td>1950</td>\n",
       "      <td>10</td>\n",
       "      <td>1550</td>\n",
       "      <td>10</td>\n",
       "      <td>10.5</td>\n",
       "      <td>10</td>\n",
       "      <td>11.6</td>\n",
       "      <td>10</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>...</td>\n",
       "      <td>123</td>\n",
       "      <td>10</td>\n",
       "      <td>2.0</td>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>10</td>\n",
       "      <td>6'25\"</td>\n",
       "      <td>10</td>\n",
       "      <td>5'30\"</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    index  男肺活量成绩  男肺活量分数  女肺活量成绩  女肺活量分数  男50米跑成绩  男50米跑分数  女50米跑成绩  女50米跑分数  \\\n",
       "0       0    4540     100    3150     100      7.1      100      7.8      100   \n",
       "1       1    4420      95    3100      95      7.2       95      7.9       95   \n",
       "2       2    4300      90    3050      90      7.3       90      8.0       90   \n",
       "3       3    4050      85    2900      85      7.4       85      8.3       85   \n",
       "4       4    3800      80    2750      80      7.5       80      8.6       80   \n",
       "5       5    3680      78    2650      78      7.7       78      8.8       78   \n",
       "6       6    3560      76    2550      76      7.9       76      9.0       76   \n",
       "7       7    3440      74    2450      74      8.1       74      9.2       74   \n",
       "8       8    3320      72    2350      72      8.3       72      9.4       72   \n",
       "9       9    3200      70    2250      70      8.5       70      9.6       70   \n",
       "10     10    3080      68    2150      68      8.7       68      9.8       68   \n",
       "11     11    2960      66    2050      66      8.9       66     10.0       66   \n",
       "12     12    2840      64    1950      64      9.1       64     10.2       64   \n",
       "13     13    2720      62    1850      62      9.3       62     10.4       62   \n",
       "14     14    2600      60    1750      60      9.5       60     10.6       60   \n",
       "15     15    2470      50    1710      50      9.7       50     10.8       50   \n",
       "16     16    2340      40    1670      40      9.9       40     11.0       40   \n",
       "17     17    2210      30    1630      30     10.1       30     11.2       30   \n",
       "18     18    2080      20    1590      20     10.3       20     11.4       20   \n",
       "19     19    1950      10    1550      10     10.5       10     11.6       10   \n",
       "\n",
       "    男体前屈成绩  ...  女跳远成绩  女跳远分数  男引体成绩  男引体分数  女仰卧成绩  女仰卧分数  男1000米跑成绩  \\\n",
       "0     23.6  ...    204    100   16.0    100     53    100      3'30\"   \n",
       "1     21.5  ...    198     95   15.0     95     51     95      3'35\"   \n",
       "2     19.4  ...    192     90   14.0     90     49     90      3'40\"   \n",
       "3     17.2  ...    185     85   13.0     85     46     85      3'47\"   \n",
       "4     15.0  ...    178     80   12.0     80     43     80      3'55\"   \n",
       "5     13.6  ...    175     78    NaN     78     41     78      4'00\"   \n",
       "6     12.2  ...    172     76   11.0     76     39     76      4'05\"   \n",
       "7     10.8  ...    169     74    NaN     74     37     74      4'10\"   \n",
       "8      9.4  ...    166     72   10.0     72     35     72      4'15\"   \n",
       "9      8.0  ...    163     70    NaN     70     33     70      4'20\"   \n",
       "10     6.6  ...    160     68    9.0     68     31     68      4'25\"   \n",
       "11     5.2  ...    157     66    NaN     66     29     66      4'30\"   \n",
       "12     3.8  ...    154     64    8.0     64     27     64      4'35\"   \n",
       "13     2.4  ...    151     62    NaN     62     25     62      4'40\"   \n",
       "14     1.0  ...    148     60    7.0     60     23     60      4'45\"   \n",
       "15     0.0  ...    143     50    6.0     50     21     50      5'05\"   \n",
       "16    -1.0  ...    138     40    5.0     40     19     40      5'25\"   \n",
       "17    -2.0  ...    133     30    4.0     30     17     30      5'45\"   \n",
       "18    -3.0  ...    128     20    3.0     20     15     20      6'05\"   \n",
       "19    -4.0  ...    123     10    2.0     10     13     10      6'25\"   \n",
       "\n",
       "    男1000米跑分数  女800米跑成绩  女800米跑分数  \n",
       "0         100     3'24\"       100  \n",
       "1          95     3'30\"        95  \n",
       "2          90     3'36\"        90  \n",
       "3          85     3'43\"        85  \n",
       "4          80     3'50\"        80  \n",
       "5          78     3'55\"        78  \n",
       "6          76     4'00\"        76  \n",
       "7          74     4'05\"        74  \n",
       "8          72     4'10\"        72  \n",
       "9          70     4'15\"        70  \n",
       "10         68     4'20\"        68  \n",
       "11         66     4'25\"        66  \n",
       "12         64     4'30\"        64  \n",
       "13         62     4'35\"        62  \n",
       "14         60     4'40\"        60  \n",
       "15         50     4'50\"        50  \n",
       "16         40     5'00\"        40  \n",
       "17         30     5'10\"        30  \n",
       "18         20     5'20\"        20  \n",
       "19         10     5'30\"        10  \n",
       "\n",
       "[20 rows x 25 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col=[]\n",
    "for name in df_score.columns:\n",
    "#     print(name)\n",
    "    name=list(name)\n",
    "    s=name[0]+name[1]\n",
    "    col.append(s)\n",
    "df_score.columns=col\n",
    "df_score.reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "da61e1c1",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 评分标准中男1000米跑和女800米跑的成绩都是4‘10’‘这种形式，需要转化为float类型值\n",
    "df_score['男1000米跑成绩'] = df_score['男1000米跑成绩'].str.extract(r'(\\d+)\\'(\\d+)\\\"').applymap(lambda x:float(x)).apply(lambda row: my_test(row[0], row[1]), axis=1)\n",
    "df_score['女800米跑成绩']=df_score['女800米跑成绩'].str.extract(r'(\\d+)\\'(\\d+)\\\"').applymap(lambda x:float(x)).apply(lambda row: my_test(row[0], row[1]), axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "c11e1537",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>男肺活量成绩</th>\n",
       "      <th>男肺活量分数</th>\n",
       "      <th>女肺活量成绩</th>\n",
       "      <th>女肺活量分数</th>\n",
       "      <th>男50米跑成绩</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>女50米跑成绩</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>男体前屈成绩</th>\n",
       "      <th>男体前屈分数</th>\n",
       "      <th>...</th>\n",
       "      <th>女跳远成绩</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>男引体成绩</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>女仰卧成绩</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>女800米跑成绩</th>\n",
       "      <th>女800米跑分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3.30</td>\n",
       "      <td>100</td>\n",
       "      <td>3.24</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3.35</td>\n",
       "      <td>95</td>\n",
       "      <td>3.30</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3.40</td>\n",
       "      <td>90</td>\n",
       "      <td>3.36</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3.47</td>\n",
       "      <td>85</td>\n",
       "      <td>3.43</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3.55</td>\n",
       "      <td>80</td>\n",
       "      <td>3.50</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3680</td>\n",
       "      <td>78</td>\n",
       "      <td>2650</td>\n",
       "      <td>78</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78</td>\n",
       "      <td>8.8</td>\n",
       "      <td>78</td>\n",
       "      <td>13.6</td>\n",
       "      <td>78</td>\n",
       "      <td>...</td>\n",
       "      <td>175</td>\n",
       "      <td>78</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>4.00</td>\n",
       "      <td>78</td>\n",
       "      <td>3.55</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3560</td>\n",
       "      <td>76</td>\n",
       "      <td>2550</td>\n",
       "      <td>76</td>\n",
       "      <td>7.9</td>\n",
       "      <td>76</td>\n",
       "      <td>9.0</td>\n",
       "      <td>76</td>\n",
       "      <td>12.2</td>\n",
       "      <td>76</td>\n",
       "      <td>...</td>\n",
       "      <td>172</td>\n",
       "      <td>76</td>\n",
       "      <td>11.0</td>\n",
       "      <td>76</td>\n",
       "      <td>39</td>\n",
       "      <td>76</td>\n",
       "      <td>4.05</td>\n",
       "      <td>76</td>\n",
       "      <td>4.00</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>3440</td>\n",
       "      <td>74</td>\n",
       "      <td>2450</td>\n",
       "      <td>74</td>\n",
       "      <td>8.1</td>\n",
       "      <td>74</td>\n",
       "      <td>9.2</td>\n",
       "      <td>74</td>\n",
       "      <td>10.8</td>\n",
       "      <td>74</td>\n",
       "      <td>...</td>\n",
       "      <td>169</td>\n",
       "      <td>74</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74</td>\n",
       "      <td>37</td>\n",
       "      <td>74</td>\n",
       "      <td>4.10</td>\n",
       "      <td>74</td>\n",
       "      <td>4.05</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3320</td>\n",
       "      <td>72</td>\n",
       "      <td>2350</td>\n",
       "      <td>72</td>\n",
       "      <td>8.3</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>...</td>\n",
       "      <td>166</td>\n",
       "      <td>72</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>4.15</td>\n",
       "      <td>72</td>\n",
       "      <td>4.10</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3200</td>\n",
       "      <td>70</td>\n",
       "      <td>2250</td>\n",
       "      <td>70</td>\n",
       "      <td>8.5</td>\n",
       "      <td>70</td>\n",
       "      <td>9.6</td>\n",
       "      <td>70</td>\n",
       "      <td>8.0</td>\n",
       "      <td>70</td>\n",
       "      <td>...</td>\n",
       "      <td>163</td>\n",
       "      <td>70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70</td>\n",
       "      <td>33</td>\n",
       "      <td>70</td>\n",
       "      <td>4.20</td>\n",
       "      <td>70</td>\n",
       "      <td>4.15</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3080</td>\n",
       "      <td>68</td>\n",
       "      <td>2150</td>\n",
       "      <td>68</td>\n",
       "      <td>8.7</td>\n",
       "      <td>68</td>\n",
       "      <td>9.8</td>\n",
       "      <td>68</td>\n",
       "      <td>6.6</td>\n",
       "      <td>68</td>\n",
       "      <td>...</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>9.0</td>\n",
       "      <td>68</td>\n",
       "      <td>31</td>\n",
       "      <td>68</td>\n",
       "      <td>4.25</td>\n",
       "      <td>68</td>\n",
       "      <td>4.20</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2960</td>\n",
       "      <td>66</td>\n",
       "      <td>2050</td>\n",
       "      <td>66</td>\n",
       "      <td>8.9</td>\n",
       "      <td>66</td>\n",
       "      <td>10.0</td>\n",
       "      <td>66</td>\n",
       "      <td>5.2</td>\n",
       "      <td>66</td>\n",
       "      <td>...</td>\n",
       "      <td>157</td>\n",
       "      <td>66</td>\n",
       "      <td>NaN</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>4.30</td>\n",
       "      <td>66</td>\n",
       "      <td>4.25</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2840</td>\n",
       "      <td>64</td>\n",
       "      <td>1950</td>\n",
       "      <td>64</td>\n",
       "      <td>9.1</td>\n",
       "      <td>64</td>\n",
       "      <td>10.2</td>\n",
       "      <td>64</td>\n",
       "      <td>3.8</td>\n",
       "      <td>64</td>\n",
       "      <td>...</td>\n",
       "      <td>154</td>\n",
       "      <td>64</td>\n",
       "      <td>8.0</td>\n",
       "      <td>64</td>\n",
       "      <td>27</td>\n",
       "      <td>64</td>\n",
       "      <td>4.35</td>\n",
       "      <td>64</td>\n",
       "      <td>4.30</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2720</td>\n",
       "      <td>62</td>\n",
       "      <td>1850</td>\n",
       "      <td>62</td>\n",
       "      <td>9.3</td>\n",
       "      <td>62</td>\n",
       "      <td>10.4</td>\n",
       "      <td>62</td>\n",
       "      <td>2.4</td>\n",
       "      <td>62</td>\n",
       "      <td>...</td>\n",
       "      <td>151</td>\n",
       "      <td>62</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62</td>\n",
       "      <td>25</td>\n",
       "      <td>62</td>\n",
       "      <td>4.40</td>\n",
       "      <td>62</td>\n",
       "      <td>4.35</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2600</td>\n",
       "      <td>60</td>\n",
       "      <td>1750</td>\n",
       "      <td>60</td>\n",
       "      <td>9.5</td>\n",
       "      <td>60</td>\n",
       "      <td>10.6</td>\n",
       "      <td>60</td>\n",
       "      <td>1.0</td>\n",
       "      <td>60</td>\n",
       "      <td>...</td>\n",
       "      <td>148</td>\n",
       "      <td>60</td>\n",
       "      <td>7.0</td>\n",
       "      <td>60</td>\n",
       "      <td>23</td>\n",
       "      <td>60</td>\n",
       "      <td>4.45</td>\n",
       "      <td>60</td>\n",
       "      <td>4.40</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2470</td>\n",
       "      <td>50</td>\n",
       "      <td>1710</td>\n",
       "      <td>50</td>\n",
       "      <td>9.7</td>\n",
       "      <td>50</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>50</td>\n",
       "      <td>...</td>\n",
       "      <td>143</td>\n",
       "      <td>50</td>\n",
       "      <td>6.0</td>\n",
       "      <td>50</td>\n",
       "      <td>21</td>\n",
       "      <td>50</td>\n",
       "      <td>5.05</td>\n",
       "      <td>50</td>\n",
       "      <td>4.50</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2340</td>\n",
       "      <td>40</td>\n",
       "      <td>1670</td>\n",
       "      <td>40</td>\n",
       "      <td>9.9</td>\n",
       "      <td>40</td>\n",
       "      <td>11.0</td>\n",
       "      <td>40</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>40</td>\n",
       "      <td>...</td>\n",
       "      <td>138</td>\n",
       "      <td>40</td>\n",
       "      <td>5.0</td>\n",
       "      <td>40</td>\n",
       "      <td>19</td>\n",
       "      <td>40</td>\n",
       "      <td>5.25</td>\n",
       "      <td>40</td>\n",
       "      <td>5.00</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2210</td>\n",
       "      <td>30</td>\n",
       "      <td>1630</td>\n",
       "      <td>30</td>\n",
       "      <td>10.1</td>\n",
       "      <td>30</td>\n",
       "      <td>11.2</td>\n",
       "      <td>30</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>30</td>\n",
       "      <td>...</td>\n",
       "      <td>133</td>\n",
       "      <td>30</td>\n",
       "      <td>4.0</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>30</td>\n",
       "      <td>5.45</td>\n",
       "      <td>30</td>\n",
       "      <td>5.10</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2080</td>\n",
       "      <td>20</td>\n",
       "      <td>1590</td>\n",
       "      <td>20</td>\n",
       "      <td>10.3</td>\n",
       "      <td>20</td>\n",
       "      <td>11.4</td>\n",
       "      <td>20</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>...</td>\n",
       "      <td>128</td>\n",
       "      <td>20</td>\n",
       "      <td>3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>15</td>\n",
       "      <td>20</td>\n",
       "      <td>6.05</td>\n",
       "      <td>20</td>\n",
       "      <td>5.20</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1950</td>\n",
       "      <td>10</td>\n",
       "      <td>1550</td>\n",
       "      <td>10</td>\n",
       "      <td>10.5</td>\n",
       "      <td>10</td>\n",
       "      <td>11.6</td>\n",
       "      <td>10</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>10</td>\n",
       "      <td>...</td>\n",
       "      <td>123</td>\n",
       "      <td>10</td>\n",
       "      <td>2.0</td>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>10</td>\n",
       "      <td>6.25</td>\n",
       "      <td>10</td>\n",
       "      <td>5.30</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    男肺活量成绩  男肺活量分数  女肺活量成绩  女肺活量分数  男50米跑成绩  男50米跑分数  女50米跑成绩  女50米跑分数  \\\n",
       "0     4540     100    3150     100      7.1      100      7.8      100   \n",
       "1     4420      95    3100      95      7.2       95      7.9       95   \n",
       "2     4300      90    3050      90      7.3       90      8.0       90   \n",
       "3     4050      85    2900      85      7.4       85      8.3       85   \n",
       "4     3800      80    2750      80      7.5       80      8.6       80   \n",
       "5     3680      78    2650      78      7.7       78      8.8       78   \n",
       "6     3560      76    2550      76      7.9       76      9.0       76   \n",
       "7     3440      74    2450      74      8.1       74      9.2       74   \n",
       "8     3320      72    2350      72      8.3       72      9.4       72   \n",
       "9     3200      70    2250      70      8.5       70      9.6       70   \n",
       "10    3080      68    2150      68      8.7       68      9.8       68   \n",
       "11    2960      66    2050      66      8.9       66     10.0       66   \n",
       "12    2840      64    1950      64      9.1       64     10.2       64   \n",
       "13    2720      62    1850      62      9.3       62     10.4       62   \n",
       "14    2600      60    1750      60      9.5       60     10.6       60   \n",
       "15    2470      50    1710      50      9.7       50     10.8       50   \n",
       "16    2340      40    1670      40      9.9       40     11.0       40   \n",
       "17    2210      30    1630      30     10.1       30     11.2       30   \n",
       "18    2080      20    1590      20     10.3       20     11.4       20   \n",
       "19    1950      10    1550      10     10.5       10     11.6       10   \n",
       "\n",
       "    男体前屈成绩  男体前屈分数  ...  女跳远成绩  女跳远分数  男引体成绩  男引体分数  女仰卧成绩  女仰卧分数  男1000米跑成绩  \\\n",
       "0     23.6     100  ...    204    100   16.0    100     53    100       3.30   \n",
       "1     21.5      95  ...    198     95   15.0     95     51     95       3.35   \n",
       "2     19.4      90  ...    192     90   14.0     90     49     90       3.40   \n",
       "3     17.2      85  ...    185     85   13.0     85     46     85       3.47   \n",
       "4     15.0      80  ...    178     80   12.0     80     43     80       3.55   \n",
       "5     13.6      78  ...    175     78    NaN     78     41     78       4.00   \n",
       "6     12.2      76  ...    172     76   11.0     76     39     76       4.05   \n",
       "7     10.8      74  ...    169     74    NaN     74     37     74       4.10   \n",
       "8      9.4      72  ...    166     72   10.0     72     35     72       4.15   \n",
       "9      8.0      70  ...    163     70    NaN     70     33     70       4.20   \n",
       "10     6.6      68  ...    160     68    9.0     68     31     68       4.25   \n",
       "11     5.2      66  ...    157     66    NaN     66     29     66       4.30   \n",
       "12     3.8      64  ...    154     64    8.0     64     27     64       4.35   \n",
       "13     2.4      62  ...    151     62    NaN     62     25     62       4.40   \n",
       "14     1.0      60  ...    148     60    7.0     60     23     60       4.45   \n",
       "15     0.0      50  ...    143     50    6.0     50     21     50       5.05   \n",
       "16    -1.0      40  ...    138     40    5.0     40     19     40       5.25   \n",
       "17    -2.0      30  ...    133     30    4.0     30     17     30       5.45   \n",
       "18    -3.0      20  ...    128     20    3.0     20     15     20       6.05   \n",
       "19    -4.0      10  ...    123     10    2.0     10     13     10       6.25   \n",
       "\n",
       "    男1000米跑分数  女800米跑成绩  女800米跑分数  \n",
       "0         100      3.24       100  \n",
       "1          95      3.30        95  \n",
       "2          90      3.36        90  \n",
       "3          85      3.43        85  \n",
       "4          80      3.50        80  \n",
       "5          78      3.55        78  \n",
       "6          76      4.00        76  \n",
       "7          74      4.05        74  \n",
       "8          72      4.10        72  \n",
       "9          70      4.15        70  \n",
       "10         68      4.20        68  \n",
       "11         66      4.25        66  \n",
       "12         64      4.30        64  \n",
       "13         62      4.35        62  \n",
       "14         60      4.40        60  \n",
       "15         50      4.50        50  \n",
       "16         40      5.00        40  \n",
       "17         30      5.10        30  \n",
       "18         20      5.20        20  \n",
       "19         10      5.30        10  \n",
       "\n",
       "[20 rows x 24 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "2300c968",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "班级           int64\n",
       "性别          object\n",
       "男1000米跑    float64\n",
       "男50米跑      float64\n",
       "男跳远        float64\n",
       "男体前屈       float64\n",
       "男引体        float64\n",
       "男肺活量       float64\n",
       "身高         float64\n",
       "体重         float64\n",
       "BMI        float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 其他所有数值类型的值，都要转换为float类型的值\n",
    "\n",
    "df1[['男50米跑','男跳远','男体前屈','男引体','男肺活量','身高','体重','BMI']]=df1[['男50米跑','男跳远','男体前屈','男引体','男肺活量','身高','体重','BMI']].applymap(lambda x:float(x))\n",
    "\n",
    "df1.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "77c5e491",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "班级          int64\n",
       "性别         object\n",
       "女800米跑    float64\n",
       "女50米跑     float64\n",
       "女跳远       float64\n",
       "女体前屈      float64\n",
       "女仰卧       float64\n",
       "女肺活量      float64\n",
       "身高        float64\n",
       "体重        float64\n",
       "BMI       float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 女800米跑\t女50米跑\t女跳远\t女体前屈\t女仰卧\t女肺活量\t身高\t体重\tBMI\n",
    "df2[['女800米跑','女50米跑','女跳远','女体前屈','女仰卧','女肺活量','身高','体重','BMI']] =df2[['女800米跑','女50米跑','女跳远','女体前屈','女仰卧','女肺活量','身高','体重','BMI']].applymap(lambda x:float(x))\n",
    "df2.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "0349389c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['男肺活量成绩', '男肺活量分数', '女肺活量成绩', '女肺活量分数', '男50米跑成绩', '男50米跑分数', '女50米跑成绩',\n",
       "       '女50米跑分数', '男体前屈成绩', '男体前屈分数', '女体前屈成绩', '女体前屈分数', '男跳远成绩', '男跳远分数',\n",
       "       '女跳远成绩', '女跳远分数', '男引体成绩', '男引体分数', '女仰卧成绩', '女仰卧分数', '男1000米跑成绩',\n",
       "       '男1000米跑分数', '女800米跑成绩', '女800米跑分数'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "5fd79ab8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "男肺活量成绩       float64\n",
       "男肺活量分数       float64\n",
       "女肺活量成绩       float64\n",
       "女肺活量分数       float64\n",
       "男50米跑成绩      float64\n",
       "男50米跑分数      float64\n",
       "女50米跑成绩      float64\n",
       "女50米跑分数      float64\n",
       "男体前屈成绩       float64\n",
       "男体前屈分数       float64\n",
       "女体前屈成绩       float64\n",
       "女体前屈分数       float64\n",
       "男跳远成绩        float64\n",
       "男跳远分数        float64\n",
       "女跳远成绩        float64\n",
       "女跳远分数        float64\n",
       "男引体成绩        float64\n",
       "男引体分数        float64\n",
       "女仰卧成绩        float64\n",
       "女仰卧分数        float64\n",
       "男1000米跑成绩    float64\n",
       "男1000米跑分数    float64\n",
       "女800米跑成绩     float64\n",
       "女800米跑分数     float64\n",
       "dtype: object"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score[['男肺活量成绩', '男肺活量分数', '女肺活量成绩', '女肺活量分数', '男50米跑分数','女50米跑分数','男体前屈分数', '女体前屈分数', '男跳远成绩', '男跳远分数',\n",
    "       '女跳远成绩', '女跳远分数','男引体分数', '女仰卧成绩', '女仰卧分数','男1000米跑分数', '女800米跑分数']]=df_score[['男肺活量成绩', '男肺活量分数', '女肺活量成绩', '女肺活量分数', '男50米跑分数','女50米跑分数','男体前屈分数', '女体前屈分数', '男跳远成绩', '男跳远分数',\n",
    "       '女跳远成绩', '女跳远分数','男引体分数', '女仰卧成绩', '女仰卧分数','男1000米跑分数', '女800米跑分数']].applymap(lambda x:float(x))\n",
    "df_score.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "76e4a418",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>男肺活量成绩</th>\n",
       "      <th>男肺活量分数</th>\n",
       "      <th>女肺活量成绩</th>\n",
       "      <th>女肺活量分数</th>\n",
       "      <th>男50米跑成绩</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>女50米跑成绩</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>男体前屈成绩</th>\n",
       "      <th>男体前屈分数</th>\n",
       "      <th>...</th>\n",
       "      <th>女跳远成绩</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>男引体成绩</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>女仰卧成绩</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>女800米跑成绩</th>\n",
       "      <th>女800米跑分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>3150.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100.0</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100.0</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100.0</td>\n",
       "      <td>...</td>\n",
       "      <td>204.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>53.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>3.30</td>\n",
       "      <td>100.0</td>\n",
       "      <td>3.24</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>3100.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95.0</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95.0</td>\n",
       "      <td>...</td>\n",
       "      <td>198.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>3.35</td>\n",
       "      <td>95.0</td>\n",
       "      <td>3.30</td>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3050.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90.0</td>\n",
       "      <td>...</td>\n",
       "      <td>192.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3.40</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3.36</td>\n",
       "      <td>90.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>2900.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85.0</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85.0</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85.0</td>\n",
       "      <td>...</td>\n",
       "      <td>185.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>3.47</td>\n",
       "      <td>85.0</td>\n",
       "      <td>3.43</td>\n",
       "      <td>85.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>2750.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80.0</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>...</td>\n",
       "      <td>178.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>43.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>3.55</td>\n",
       "      <td>80.0</td>\n",
       "      <td>3.50</td>\n",
       "      <td>80.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3680.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>2650.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78.0</td>\n",
       "      <td>8.8</td>\n",
       "      <td>78.0</td>\n",
       "      <td>13.6</td>\n",
       "      <td>78.0</td>\n",
       "      <td>...</td>\n",
       "      <td>175.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>78.0</td>\n",
       "      <td>3.55</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3560.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>2550.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>76.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>12.2</td>\n",
       "      <td>76.0</td>\n",
       "      <td>...</td>\n",
       "      <td>172.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>4.05</td>\n",
       "      <td>76.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>3440.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>2450.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>8.1</td>\n",
       "      <td>74.0</td>\n",
       "      <td>9.2</td>\n",
       "      <td>74.0</td>\n",
       "      <td>10.8</td>\n",
       "      <td>74.0</td>\n",
       "      <td>...</td>\n",
       "      <td>169.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>4.10</td>\n",
       "      <td>74.0</td>\n",
       "      <td>4.05</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3320.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>2350.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>8.3</td>\n",
       "      <td>72.0</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72.0</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72.0</td>\n",
       "      <td>...</td>\n",
       "      <td>166.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>4.15</td>\n",
       "      <td>72.0</td>\n",
       "      <td>4.10</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3200.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>2250.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>8.5</td>\n",
       "      <td>70.0</td>\n",
       "      <td>9.6</td>\n",
       "      <td>70.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>...</td>\n",
       "      <td>163.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>4.20</td>\n",
       "      <td>70.0</td>\n",
       "      <td>4.15</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3080.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>2150.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>8.7</td>\n",
       "      <td>68.0</td>\n",
       "      <td>9.8</td>\n",
       "      <td>68.0</td>\n",
       "      <td>6.6</td>\n",
       "      <td>68.0</td>\n",
       "      <td>...</td>\n",
       "      <td>160.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>4.25</td>\n",
       "      <td>68.0</td>\n",
       "      <td>4.20</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2960.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>2050.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>8.9</td>\n",
       "      <td>66.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>66.0</td>\n",
       "      <td>...</td>\n",
       "      <td>157.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>66.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>4.30</td>\n",
       "      <td>66.0</td>\n",
       "      <td>4.25</td>\n",
       "      <td>66.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2840.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>1950.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>9.1</td>\n",
       "      <td>64.0</td>\n",
       "      <td>10.2</td>\n",
       "      <td>64.0</td>\n",
       "      <td>3.8</td>\n",
       "      <td>64.0</td>\n",
       "      <td>...</td>\n",
       "      <td>154.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>27.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>4.35</td>\n",
       "      <td>64.0</td>\n",
       "      <td>4.30</td>\n",
       "      <td>64.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2720.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>1850.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>9.3</td>\n",
       "      <td>62.0</td>\n",
       "      <td>10.4</td>\n",
       "      <td>62.0</td>\n",
       "      <td>2.4</td>\n",
       "      <td>62.0</td>\n",
       "      <td>...</td>\n",
       "      <td>151.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>4.40</td>\n",
       "      <td>62.0</td>\n",
       "      <td>4.35</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2600.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1750.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>9.5</td>\n",
       "      <td>60.0</td>\n",
       "      <td>10.6</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>...</td>\n",
       "      <td>148.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>4.45</td>\n",
       "      <td>60.0</td>\n",
       "      <td>4.40</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2470.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>1710.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>9.7</td>\n",
       "      <td>50.0</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>...</td>\n",
       "      <td>143.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>5.05</td>\n",
       "      <td>50.0</td>\n",
       "      <td>4.50</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2340.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>1670.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>9.9</td>\n",
       "      <td>40.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>...</td>\n",
       "      <td>138.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>5.25</td>\n",
       "      <td>40.0</td>\n",
       "      <td>5.00</td>\n",
       "      <td>40.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2210.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>1630.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>10.1</td>\n",
       "      <td>30.0</td>\n",
       "      <td>11.2</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>...</td>\n",
       "      <td>133.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>5.45</td>\n",
       "      <td>30.0</td>\n",
       "      <td>5.10</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2080.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>1590.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>10.3</td>\n",
       "      <td>20.0</td>\n",
       "      <td>11.4</td>\n",
       "      <td>20.0</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>...</td>\n",
       "      <td>128.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>6.05</td>\n",
       "      <td>20.0</td>\n",
       "      <td>5.20</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1950.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>1550.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>10.5</td>\n",
       "      <td>10.0</td>\n",
       "      <td>11.6</td>\n",
       "      <td>10.0</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>...</td>\n",
       "      <td>123.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>6.25</td>\n",
       "      <td>10.0</td>\n",
       "      <td>5.30</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    男肺活量成绩  男肺活量分数  女肺活量成绩  女肺活量分数  男50米跑成绩  男50米跑分数  女50米跑成绩  女50米跑分数  \\\n",
       "0   4540.0   100.0  3150.0   100.0      7.1    100.0      7.8    100.0   \n",
       "1   4420.0    95.0  3100.0    95.0      7.2     95.0      7.9     95.0   \n",
       "2   4300.0    90.0  3050.0    90.0      7.3     90.0      8.0     90.0   \n",
       "3   4050.0    85.0  2900.0    85.0      7.4     85.0      8.3     85.0   \n",
       "4   3800.0    80.0  2750.0    80.0      7.5     80.0      8.6     80.0   \n",
       "5   3680.0    78.0  2650.0    78.0      7.7     78.0      8.8     78.0   \n",
       "6   3560.0    76.0  2550.0    76.0      7.9     76.0      9.0     76.0   \n",
       "7   3440.0    74.0  2450.0    74.0      8.1     74.0      9.2     74.0   \n",
       "8   3320.0    72.0  2350.0    72.0      8.3     72.0      9.4     72.0   \n",
       "9   3200.0    70.0  2250.0    70.0      8.5     70.0      9.6     70.0   \n",
       "10  3080.0    68.0  2150.0    68.0      8.7     68.0      9.8     68.0   \n",
       "11  2960.0    66.0  2050.0    66.0      8.9     66.0     10.0     66.0   \n",
       "12  2840.0    64.0  1950.0    64.0      9.1     64.0     10.2     64.0   \n",
       "13  2720.0    62.0  1850.0    62.0      9.3     62.0     10.4     62.0   \n",
       "14  2600.0    60.0  1750.0    60.0      9.5     60.0     10.6     60.0   \n",
       "15  2470.0    50.0  1710.0    50.0      9.7     50.0     10.8     50.0   \n",
       "16  2340.0    40.0  1670.0    40.0      9.9     40.0     11.0     40.0   \n",
       "17  2210.0    30.0  1630.0    30.0     10.1     30.0     11.2     30.0   \n",
       "18  2080.0    20.0  1590.0    20.0     10.3     20.0     11.4     20.0   \n",
       "19  1950.0    10.0  1550.0    10.0     10.5     10.0     11.6     10.0   \n",
       "\n",
       "    男体前屈成绩  男体前屈分数  ...  女跳远成绩  女跳远分数  男引体成绩  男引体分数  女仰卧成绩  女仰卧分数  男1000米跑成绩  \\\n",
       "0     23.6   100.0  ...  204.0  100.0   16.0  100.0   53.0  100.0       3.30   \n",
       "1     21.5    95.0  ...  198.0   95.0   15.0   95.0   51.0   95.0       3.35   \n",
       "2     19.4    90.0  ...  192.0   90.0   14.0   90.0   49.0   90.0       3.40   \n",
       "3     17.2    85.0  ...  185.0   85.0   13.0   85.0   46.0   85.0       3.47   \n",
       "4     15.0    80.0  ...  178.0   80.0   12.0   80.0   43.0   80.0       3.55   \n",
       "5     13.6    78.0  ...  175.0   78.0    NaN   78.0   41.0   78.0       4.00   \n",
       "6     12.2    76.0  ...  172.0   76.0   11.0   76.0   39.0   76.0       4.05   \n",
       "7     10.8    74.0  ...  169.0   74.0    NaN   74.0   37.0   74.0       4.10   \n",
       "8      9.4    72.0  ...  166.0   72.0   10.0   72.0   35.0   72.0       4.15   \n",
       "9      8.0    70.0  ...  163.0   70.0    NaN   70.0   33.0   70.0       4.20   \n",
       "10     6.6    68.0  ...  160.0   68.0    9.0   68.0   31.0   68.0       4.25   \n",
       "11     5.2    66.0  ...  157.0   66.0    NaN   66.0   29.0   66.0       4.30   \n",
       "12     3.8    64.0  ...  154.0   64.0    8.0   64.0   27.0   64.0       4.35   \n",
       "13     2.4    62.0  ...  151.0   62.0    NaN   62.0   25.0   62.0       4.40   \n",
       "14     1.0    60.0  ...  148.0   60.0    7.0   60.0   23.0   60.0       4.45   \n",
       "15     0.0    50.0  ...  143.0   50.0    6.0   50.0   21.0   50.0       5.05   \n",
       "16    -1.0    40.0  ...  138.0   40.0    5.0   40.0   19.0   40.0       5.25   \n",
       "17    -2.0    30.0  ...  133.0   30.0    4.0   30.0   17.0   30.0       5.45   \n",
       "18    -3.0    20.0  ...  128.0   20.0    3.0   20.0   15.0   20.0       6.05   \n",
       "19    -4.0    10.0  ...  123.0   10.0    2.0   10.0   13.0   10.0       6.25   \n",
       "\n",
       "    男1000米跑分数  女800米跑成绩  女800米跑分数  \n",
       "0       100.0      3.24     100.0  \n",
       "1        95.0      3.30      95.0  \n",
       "2        90.0      3.36      90.0  \n",
       "3        85.0      3.43      85.0  \n",
       "4        80.0      3.50      80.0  \n",
       "5        78.0      3.55      78.0  \n",
       "6        76.0      4.00      76.0  \n",
       "7        74.0      4.05      74.0  \n",
       "8        72.0      4.10      72.0  \n",
       "9        70.0      4.15      70.0  \n",
       "10       68.0      4.20      68.0  \n",
       "11       66.0      4.25      66.0  \n",
       "12       64.0      4.30      64.0  \n",
       "13       62.0      4.35      62.0  \n",
       "14       60.0      4.40      60.0  \n",
       "15       50.0      4.50      50.0  \n",
       "16       40.0      5.00      40.0  \n",
       "17       30.0      5.10      30.0  \n",
       "18       20.0      5.20      20.0  \n",
       "19       10.0      5.30      10.0  \n",
       "\n",
       "[20 rows x 24 columns]"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "e7916f7b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.13</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2785.0</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.16</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>3133.0</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.09</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3901.0</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.21</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>4946.0</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.44</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>3538.0</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.23</td>\n",
       "      <td>8.27</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4647.0</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>473</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.19</td>\n",
       "      <td>9.55</td>\n",
       "      <td>210.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>7042.0</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>474</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3.25</td>\n",
       "      <td>7.50</td>\n",
       "      <td>252.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>5755.0</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.39</td>\n",
       "      <td>7.81</td>\n",
       "      <td>208.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>5688.0</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>477 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  男1000米跑  男50米跑    男跳远  男体前屈   男引体    男肺活量     身高    体重  BMI\n",
       "0     1  男     4.13   8.88  195.0  12.0   1.0  2785.0  170.0  72.6  0.0\n",
       "1     1  男     4.16   7.70  225.0  11.0   7.0  3133.0  174.0  52.7  0.0\n",
       "2     1  男     4.09   8.45  218.0  14.0   1.0  3901.0  169.0  46.5  0.0\n",
       "3     1  男     4.21   8.05  206.0  13.0   1.0  4946.0  183.0  79.7  0.0\n",
       "4     1  男     3.44   7.52  210.0  13.0   9.0  3538.0  171.0  54.7  0.0\n",
       "..   .. ..      ...    ...    ...   ...   ...     ...    ...   ...  ...\n",
       "472  17  男     4.23   8.27  208.0  10.0   0.0  4647.0  176.0  69.5  0.0\n",
       "473  17  男     5.19   9.55  210.0  15.0   6.0  7042.0  177.0  76.0  0.0\n",
       "474  17  男     3.25   7.50  252.0  13.0  13.0  5755.0  181.0  65.0  0.0\n",
       "475  17  男     4.39   7.81  208.0  14.0  11.0  5688.0  172.0  51.7  0.0\n",
       "476  17  男      NaN   0.00    0.0   0.0   0.0     0.0    0.0   0.0  0.0\n",
       "\n",
       "[477 rows x 11 columns]"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "90ef914a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3.30</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3.35</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.40</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3.47</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3.55</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4.00</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4.05</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4.10</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4.15</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>4.20</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>4.25</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>4.30</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4.35</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4.40</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4.45</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>5.05</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>5.25</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>5.45</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>6.05</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>6.25</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    男1000米跑成绩  男1000米跑分数\n",
       "0        3.30        100\n",
       "1        3.35         95\n",
       "2        3.40         90\n",
       "3        3.47         85\n",
       "4        3.55         80\n",
       "5        4.00         78\n",
       "6        4.05         76\n",
       "7        4.10         74\n",
       "8        4.15         72\n",
       "9        4.20         70\n",
       "10       4.25         68\n",
       "11       4.30         66\n",
       "12       4.35         64\n",
       "13       4.40         62\n",
       "14       4.45         60\n",
       "15       5.05         50\n",
       "16       5.25         40\n",
       "17       5.45         30\n",
       "18       6.05         20\n",
       "19       6.25         10"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score[['男1000米跑成绩','男1000米跑分数']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "1fe7abf1",
   "metadata": {},
   "outputs": [],
   "source": [
    "# \n",
    "df1['男1000米跑分数']=pd.cut(df1['男1000米跑'],bins=[float('-inf') ]+list(df_score['男1000米跑成绩'])\n",
    "                 ,# 左开右闭\n",
    "                  labels=df_score['男1000米跑分数']\n",
    "      )\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "363a6c6c",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1['男50米跑分数']=pd.cut(df1['男50米跑'],bins=[float('-inf') ]+list(df_score['男50米跑成绩']),# 闭\n",
    "                  labels=df_score['男50米跑分数'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "a5f8069f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>男跳远成绩</th>\n",
       "      <th>男跳远分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>260.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>255.0</td>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>250.0</td>\n",
       "      <td>90.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>243.0</td>\n",
       "      <td>85.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>235.0</td>\n",
       "      <td>80.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>231.0</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>227.0</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>223.0</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>219.0</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>215.0</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>211.0</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>207.0</td>\n",
       "      <td>66.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>203.0</td>\n",
       "      <td>64.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>199.0</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>195.0</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>190.0</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>185.0</td>\n",
       "      <td>40.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>180.0</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>175.0</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>170.0</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    男跳远成绩  男跳远分数\n",
       "0   260.0  100.0\n",
       "1   255.0   95.0\n",
       "2   250.0   90.0\n",
       "3   243.0   85.0\n",
       "4   235.0   80.0\n",
       "5   231.0   78.0\n",
       "6   227.0   76.0\n",
       "7   223.0   74.0\n",
       "8   219.0   72.0\n",
       "9   215.0   70.0\n",
       "10  211.0   68.0\n",
       "11  207.0   66.0\n",
       "12  203.0   64.0\n",
       "13  199.0   62.0\n",
       "14  195.0   60.0\n",
       "15  190.0   50.0\n",
       "16  185.0   40.0\n",
       "17  180.0   30.0\n",
       "18  175.0   20.0\n",
       "19  170.0   10.0"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score[['男跳远成绩','男跳远分数']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "f86acabe",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 男跳远\t男体前屈\t男引体\t男肺活量\t+[float('inf') ]\n",
    "df1['男跳远分数']=pd.cut(df1['男跳远'],bins=[float('-inf') ]+list(df_score['男跳远成绩'].sort_values())+[float('inf') ]\n",
    "                  ,right=False\n",
    "                  ,labels=[0.0]+list(df_score['男跳远分数'].sort_values()) \n",
    "      )\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "7b500830",
   "metadata": {},
   "outputs": [],
   "source": [
    "#存在缺失值\n",
    "#填充~\n",
    "df_score_=df_score[['男引体成绩','男引体分数']].dropna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "d037ee1a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.,  7.,  9., 10., 11., 15.,  3.,  0.,  5.,  4., 12., 16.,  2.,\n",
       "       20.,  8.,  6., 14., 13., 17., 18., 19., 21., 23.])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1['男引体'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "6f04ceed",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1['男体前屈分数']=pd.cut(df1['男体前屈'],bins=[float('-inf') ]+list(df_score['男体前屈成绩'].sort_values())+[float('inf') ]\n",
    "       ,right=False\n",
    "                   ,labels=[0.0]+list(df_score['男体前屈分数'].sort_values())\n",
    "      )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "31c94094",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1['男引体分数'] = pd.cut(df1['男引体'],bins=[float('-inf') ]+list(df_score_['男引体成绩'].sort_values())+[float('inf') ],right=False,# 左右开\n",
    "                  labels=[0.0]+list(df_score_['男引体分数'].sort_values()))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "d47420fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       0.0\n",
       "1      60.0\n",
       "2       0.0\n",
       "3       0.0\n",
       "4      68.0\n",
       "       ... \n",
       "472     0.0\n",
       "473    50.0\n",
       "474    85.0\n",
       "475    76.0\n",
       "476     0.0\n",
       "Name: 男引体分数, Length: 477, dtype: category\n",
       "Categories (16, float64): [0.0 < 10.0 < 20.0 < 30.0 ... 85.0 < 90.0 < 95.0 < 100.0]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1['男引体分数']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "e7f2e1aa",
   "metadata": {},
   "outputs": [],
   "source": [
    "df1['男肺活量分数'] =pd.cut(df1['男肺活量'],bins=[float('-inf') ]+list(df_score['男肺活量成绩'].sort_values())+[float('inf') ]\n",
    "                      ,right = False\n",
    "                  ,labels=[0.0]+list(df_score['男肺活量分数'].sort_values())\n",
    "                     )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "e7ff2519",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "#身高体重，计算BMI\n",
    "def comput_bmi(w,h):\n",
    "\n",
    "    if h >0.0:\n",
    "       return w/np.square(h/100)\n",
    "    else :\n",
    "       return 0.0\n",
    "    \n",
    "\n",
    "df1['BMI']=df1[['体重','身高']].apply(lambda row: comput_bmi(row['体重'],row['身高']),axis=1).round(2) \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "17c49a97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      25.12\n",
       "1      17.41\n",
       "2      16.28\n",
       "3      23.80\n",
       "4      18.71\n",
       "       ...  \n",
       "472    22.44\n",
       "473    24.26\n",
       "474    19.84\n",
       "475    17.48\n",
       "476     0.00\n",
       "Name: BMI, Length: 477, dtype: float64"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1['BMI']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "id": "978028ab",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# df1.to_excel('./体测分数_男生.xls',encoding='utf-8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "78585c10",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "new_columns=['班级','性别','男1000米跑','男1000米跑分数','男50米跑','男50米跑分数','男跳远','男跳远分数','男体前屈','男体前屈分数','男引体','男引体分数','男肺活量','男肺活量分数','身高','体重','BMI']\n",
    "df1.reindex(columns=new_columns).to_excel('./体测分数_男生.xls',encoding='utf-8')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "ba5c1a50",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>48.0</td>\n",
       "      <td>3775.0</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>3683.0</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>3331.0</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>3701.0</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>3592.0</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>588</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>9.60</td>\n",
       "      <td>150.0</td>\n",
       "      <td>24.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>2255.0</td>\n",
       "      <td>158.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>589</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.00</td>\n",
       "      <td>10.18</td>\n",
       "      <td>150.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>2937.0</td>\n",
       "      <td>161.0</td>\n",
       "      <td>55.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>590</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>10.18</td>\n",
       "      <td>152.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>2592.0</td>\n",
       "      <td>165.0</td>\n",
       "      <td>48.6</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>591</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.01</td>\n",
       "      <td>9.67</td>\n",
       "      <td>165.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>1829.0</td>\n",
       "      <td>154.0</td>\n",
       "      <td>43.6</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>17</td>\n",
       "      <td>女</td>\n",
       "      <td>4.48</td>\n",
       "      <td>9.09</td>\n",
       "      <td>180.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>2962.0</td>\n",
       "      <td>162.0</td>\n",
       "      <td>55.3</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>593 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别  女800米跑  女50米跑    女跳远  女体前屈   女仰卧    女肺活量     身高    体重  BMI\n",
       "0     1  女    3.22   9.32  185.0  16.0  48.0  3775.0  163.0  51.3  0.0\n",
       "1     1  女    4.59  11.44  148.0   9.0  29.0  3683.0  163.0  66.6  0.0\n",
       "2     1  女    3.46  13.40  150.0   7.0  40.0  3331.0  157.0  60.0  0.0\n",
       "3     1  女    3.39   9.52  172.0  21.0  46.0  3701.0  160.0  50.7  0.0\n",
       "4     1  女    3.43   9.79  145.0   8.0  34.0  3592.0  167.0  63.9  0.0\n",
       "..   .. ..     ...    ...    ...   ...   ...     ...    ...   ...  ...\n",
       "588  17  女    3.51   9.60  150.0  24.0  41.0  2255.0  158.0  49.0  0.0\n",
       "589  17  女    4.00  10.18  150.0  13.0  36.0  2937.0  161.0  55.7  0.0\n",
       "590  17  女    3.45  10.18  152.0  15.0  35.0  2592.0  165.0  48.6  0.0\n",
       "591  17  女    4.01   9.67  165.0  10.0  41.0  1829.0  154.0  43.6  0.0\n",
       "592  17  女    4.48   9.09  180.0  10.0  46.0  2962.0  162.0  55.3  0.0\n",
       "\n",
       "[593 rows x 11 columns]"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "id": "fded5d3d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>男肺活量成绩</th>\n",
       "      <th>男肺活量分数</th>\n",
       "      <th>女肺活量成绩</th>\n",
       "      <th>女肺活量分数</th>\n",
       "      <th>男50米跑成绩</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>女50米跑成绩</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>男体前屈成绩</th>\n",
       "      <th>男体前屈分数</th>\n",
       "      <th>...</th>\n",
       "      <th>女跳远成绩</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>男引体成绩</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>女仰卧成绩</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>男1000米跑成绩</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>女800米跑成绩</th>\n",
       "      <th>女800米跑分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4540.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>3150.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100.0</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100.0</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100.0</td>\n",
       "      <td>...</td>\n",
       "      <td>204.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>53.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>3.30</td>\n",
       "      <td>100.0</td>\n",
       "      <td>3.24</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4420.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>3100.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95.0</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95.0</td>\n",
       "      <td>...</td>\n",
       "      <td>198.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>51.0</td>\n",
       "      <td>95.0</td>\n",
       "      <td>3.35</td>\n",
       "      <td>95.0</td>\n",
       "      <td>3.30</td>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4300.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3050.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90.0</td>\n",
       "      <td>...</td>\n",
       "      <td>192.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>49.0</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3.40</td>\n",
       "      <td>90.0</td>\n",
       "      <td>3.36</td>\n",
       "      <td>90.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4050.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>2900.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85.0</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85.0</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85.0</td>\n",
       "      <td>...</td>\n",
       "      <td>185.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>46.0</td>\n",
       "      <td>85.0</td>\n",
       "      <td>3.47</td>\n",
       "      <td>85.0</td>\n",
       "      <td>3.43</td>\n",
       "      <td>85.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3800.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>2750.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80.0</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>...</td>\n",
       "      <td>178.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>43.0</td>\n",
       "      <td>80.0</td>\n",
       "      <td>3.55</td>\n",
       "      <td>80.0</td>\n",
       "      <td>3.50</td>\n",
       "      <td>80.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3680.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>2650.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78.0</td>\n",
       "      <td>8.8</td>\n",
       "      <td>78.0</td>\n",
       "      <td>13.6</td>\n",
       "      <td>78.0</td>\n",
       "      <td>...</td>\n",
       "      <td>175.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.0</td>\n",
       "      <td>41.0</td>\n",
       "      <td>78.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>78.0</td>\n",
       "      <td>3.55</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3560.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>2550.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>7.9</td>\n",
       "      <td>76.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>12.2</td>\n",
       "      <td>76.0</td>\n",
       "      <td>...</td>\n",
       "      <td>172.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>39.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>4.05</td>\n",
       "      <td>76.0</td>\n",
       "      <td>4.00</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>3440.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>2450.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>8.1</td>\n",
       "      <td>74.0</td>\n",
       "      <td>9.2</td>\n",
       "      <td>74.0</td>\n",
       "      <td>10.8</td>\n",
       "      <td>74.0</td>\n",
       "      <td>...</td>\n",
       "      <td>169.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>74.0</td>\n",
       "      <td>4.10</td>\n",
       "      <td>74.0</td>\n",
       "      <td>4.05</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>3320.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>2350.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>8.3</td>\n",
       "      <td>72.0</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72.0</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72.0</td>\n",
       "      <td>...</td>\n",
       "      <td>166.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>72.0</td>\n",
       "      <td>4.15</td>\n",
       "      <td>72.0</td>\n",
       "      <td>4.10</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>3200.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>2250.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>8.5</td>\n",
       "      <td>70.0</td>\n",
       "      <td>9.6</td>\n",
       "      <td>70.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>...</td>\n",
       "      <td>163.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70.0</td>\n",
       "      <td>33.0</td>\n",
       "      <td>70.0</td>\n",
       "      <td>4.20</td>\n",
       "      <td>70.0</td>\n",
       "      <td>4.15</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>3080.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>2150.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>8.7</td>\n",
       "      <td>68.0</td>\n",
       "      <td>9.8</td>\n",
       "      <td>68.0</td>\n",
       "      <td>6.6</td>\n",
       "      <td>68.0</td>\n",
       "      <td>...</td>\n",
       "      <td>160.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>31.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>4.25</td>\n",
       "      <td>68.0</td>\n",
       "      <td>4.20</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2960.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>2050.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>8.9</td>\n",
       "      <td>66.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>66.0</td>\n",
       "      <td>...</td>\n",
       "      <td>157.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>66.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>66.0</td>\n",
       "      <td>4.30</td>\n",
       "      <td>66.0</td>\n",
       "      <td>4.25</td>\n",
       "      <td>66.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2840.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>1950.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>9.1</td>\n",
       "      <td>64.0</td>\n",
       "      <td>10.2</td>\n",
       "      <td>64.0</td>\n",
       "      <td>3.8</td>\n",
       "      <td>64.0</td>\n",
       "      <td>...</td>\n",
       "      <td>154.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>27.0</td>\n",
       "      <td>64.0</td>\n",
       "      <td>4.35</td>\n",
       "      <td>64.0</td>\n",
       "      <td>4.30</td>\n",
       "      <td>64.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2720.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>1850.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>9.3</td>\n",
       "      <td>62.0</td>\n",
       "      <td>10.4</td>\n",
       "      <td>62.0</td>\n",
       "      <td>2.4</td>\n",
       "      <td>62.0</td>\n",
       "      <td>...</td>\n",
       "      <td>151.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>62.0</td>\n",
       "      <td>4.40</td>\n",
       "      <td>62.0</td>\n",
       "      <td>4.35</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2600.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1750.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>9.5</td>\n",
       "      <td>60.0</td>\n",
       "      <td>10.6</td>\n",
       "      <td>60.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>...</td>\n",
       "      <td>148.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>23.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>4.45</td>\n",
       "      <td>60.0</td>\n",
       "      <td>4.40</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2470.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>1710.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>9.7</td>\n",
       "      <td>50.0</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>...</td>\n",
       "      <td>143.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>21.0</td>\n",
       "      <td>50.0</td>\n",
       "      <td>5.05</td>\n",
       "      <td>50.0</td>\n",
       "      <td>4.50</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2340.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>1670.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>9.9</td>\n",
       "      <td>40.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>...</td>\n",
       "      <td>138.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>40.0</td>\n",
       "      <td>5.25</td>\n",
       "      <td>40.0</td>\n",
       "      <td>5.00</td>\n",
       "      <td>40.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2210.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>1630.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>10.1</td>\n",
       "      <td>30.0</td>\n",
       "      <td>11.2</td>\n",
       "      <td>30.0</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>...</td>\n",
       "      <td>133.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>17.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>5.45</td>\n",
       "      <td>30.0</td>\n",
       "      <td>5.10</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2080.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>1590.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>10.3</td>\n",
       "      <td>20.0</td>\n",
       "      <td>11.4</td>\n",
       "      <td>20.0</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>...</td>\n",
       "      <td>128.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>20.0</td>\n",
       "      <td>6.05</td>\n",
       "      <td>20.0</td>\n",
       "      <td>5.20</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1950.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>1550.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>10.5</td>\n",
       "      <td>10.0</td>\n",
       "      <td>11.6</td>\n",
       "      <td>10.0</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>...</td>\n",
       "      <td>123.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>13.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>6.25</td>\n",
       "      <td>10.0</td>\n",
       "      <td>5.30</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    男肺活量成绩  男肺活量分数  女肺活量成绩  女肺活量分数  男50米跑成绩  男50米跑分数  女50米跑成绩  女50米跑分数  \\\n",
       "0   4540.0   100.0  3150.0   100.0      7.1    100.0      7.8    100.0   \n",
       "1   4420.0    95.0  3100.0    95.0      7.2     95.0      7.9     95.0   \n",
       "2   4300.0    90.0  3050.0    90.0      7.3     90.0      8.0     90.0   \n",
       "3   4050.0    85.0  2900.0    85.0      7.4     85.0      8.3     85.0   \n",
       "4   3800.0    80.0  2750.0    80.0      7.5     80.0      8.6     80.0   \n",
       "5   3680.0    78.0  2650.0    78.0      7.7     78.0      8.8     78.0   \n",
       "6   3560.0    76.0  2550.0    76.0      7.9     76.0      9.0     76.0   \n",
       "7   3440.0    74.0  2450.0    74.0      8.1     74.0      9.2     74.0   \n",
       "8   3320.0    72.0  2350.0    72.0      8.3     72.0      9.4     72.0   \n",
       "9   3200.0    70.0  2250.0    70.0      8.5     70.0      9.6     70.0   \n",
       "10  3080.0    68.0  2150.0    68.0      8.7     68.0      9.8     68.0   \n",
       "11  2960.0    66.0  2050.0    66.0      8.9     66.0     10.0     66.0   \n",
       "12  2840.0    64.0  1950.0    64.0      9.1     64.0     10.2     64.0   \n",
       "13  2720.0    62.0  1850.0    62.0      9.3     62.0     10.4     62.0   \n",
       "14  2600.0    60.0  1750.0    60.0      9.5     60.0     10.6     60.0   \n",
       "15  2470.0    50.0  1710.0    50.0      9.7     50.0     10.8     50.0   \n",
       "16  2340.0    40.0  1670.0    40.0      9.9     40.0     11.0     40.0   \n",
       "17  2210.0    30.0  1630.0    30.0     10.1     30.0     11.2     30.0   \n",
       "18  2080.0    20.0  1590.0    20.0     10.3     20.0     11.4     20.0   \n",
       "19  1950.0    10.0  1550.0    10.0     10.5     10.0     11.6     10.0   \n",
       "\n",
       "    男体前屈成绩  男体前屈分数  ...  女跳远成绩  女跳远分数  男引体成绩  男引体分数  女仰卧成绩  女仰卧分数  男1000米跑成绩  \\\n",
       "0     23.6   100.0  ...  204.0  100.0   16.0  100.0   53.0  100.0       3.30   \n",
       "1     21.5    95.0  ...  198.0   95.0   15.0   95.0   51.0   95.0       3.35   \n",
       "2     19.4    90.0  ...  192.0   90.0   14.0   90.0   49.0   90.0       3.40   \n",
       "3     17.2    85.0  ...  185.0   85.0   13.0   85.0   46.0   85.0       3.47   \n",
       "4     15.0    80.0  ...  178.0   80.0   12.0   80.0   43.0   80.0       3.55   \n",
       "5     13.6    78.0  ...  175.0   78.0    NaN   78.0   41.0   78.0       4.00   \n",
       "6     12.2    76.0  ...  172.0   76.0   11.0   76.0   39.0   76.0       4.05   \n",
       "7     10.8    74.0  ...  169.0   74.0    NaN   74.0   37.0   74.0       4.10   \n",
       "8      9.4    72.0  ...  166.0   72.0   10.0   72.0   35.0   72.0       4.15   \n",
       "9      8.0    70.0  ...  163.0   70.0    NaN   70.0   33.0   70.0       4.20   \n",
       "10     6.6    68.0  ...  160.0   68.0    9.0   68.0   31.0   68.0       4.25   \n",
       "11     5.2    66.0  ...  157.0   66.0    NaN   66.0   29.0   66.0       4.30   \n",
       "12     3.8    64.0  ...  154.0   64.0    8.0   64.0   27.0   64.0       4.35   \n",
       "13     2.4    62.0  ...  151.0   62.0    NaN   62.0   25.0   62.0       4.40   \n",
       "14     1.0    60.0  ...  148.0   60.0    7.0   60.0   23.0   60.0       4.45   \n",
       "15     0.0    50.0  ...  143.0   50.0    6.0   50.0   21.0   50.0       5.05   \n",
       "16    -1.0    40.0  ...  138.0   40.0    5.0   40.0   19.0   40.0       5.25   \n",
       "17    -2.0    30.0  ...  133.0   30.0    4.0   30.0   17.0   30.0       5.45   \n",
       "18    -3.0    20.0  ...  128.0   20.0    3.0   20.0   15.0   20.0       6.05   \n",
       "19    -4.0    10.0  ...  123.0   10.0    2.0   10.0   13.0   10.0       6.25   \n",
       "\n",
       "    男1000米跑分数  女800米跑成绩  女800米跑分数  \n",
       "0       100.0      3.24     100.0  \n",
       "1        95.0      3.30      95.0  \n",
       "2        90.0      3.36      90.0  \n",
       "3        85.0      3.43      85.0  \n",
       "4        80.0      3.50      80.0  \n",
       "5        78.0      3.55      78.0  \n",
       "6        76.0      4.00      76.0  \n",
       "7        74.0      4.05      74.0  \n",
       "8        72.0      4.10      72.0  \n",
       "9        70.0      4.15      70.0  \n",
       "10       68.0      4.20      68.0  \n",
       "11       66.0      4.25      66.0  \n",
       "12       64.0      4.30      64.0  \n",
       "13       62.0      4.35      62.0  \n",
       "14       60.0      4.40      60.0  \n",
       "15       50.0      4.50      50.0  \n",
       "16       40.0      5.00      40.0  \n",
       "17       30.0      5.10      30.0  \n",
       "18       20.0      5.20      20.0  \n",
       "19       10.0      5.30      10.0  \n",
       "\n",
       "[20 rows x 24 columns]"
      ]
     },
     "execution_count": 174,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b60b9053",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_score[['女50米跑成绩','女50米跑分数']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "8d1f5f00",
   "metadata": {},
   "outputs": [],
   "source": [
    "# \n",
    "df2['女800米跑分数']=pd.cut(df2['女800米跑'],bins=[float('-inf') ]+list(df_score['女800米跑成绩']),# 左闭右开\n",
    "                  labels=df_score['女800米跑分数'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "be12b181",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "df2['女50米跑分数']=pd.cut(df2['女50米跑'],bins=[float('-inf') ]+list(df_score['女50米跑成绩'])+[float('inf') ]\n",
    "        ,labels=list(df_score['女50米跑分数'])+[0.0]\n",
    "                  )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "1513ead2",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2['女跳远分数'] = pd.cut(df2['女跳远'],bins=[float('-inf') ]+list(df_score['女跳远成绩'].sort_values())+[float('inf') ]\n",
    "                  ,right = False# 左闭右开\n",
    "                  ,labels=[0.0]+list(df_score['女跳远分数'].sort_values())\n",
    "      )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "6b0f3492",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>女体前屈成绩</th>\n",
       "      <th>女体前屈分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>24.2</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>22.5</td>\n",
       "      <td>95.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20.8</td>\n",
       "      <td>90.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>19.1</td>\n",
       "      <td>85.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>17.4</td>\n",
       "      <td>80.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>16.1</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>14.8</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>13.5</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>12.2</td>\n",
       "      <td>72.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>10.9</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>9.6</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>8.3</td>\n",
       "      <td>66.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>7.0</td>\n",
       "      <td>64.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>5.7</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4.4</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>3.6</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2.8</td>\n",
       "      <td>40.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2.0</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1.2</td>\n",
       "      <td>20.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0.4</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    女体前屈成绩  女体前屈分数\n",
       "0     24.2   100.0\n",
       "1     22.5    95.0\n",
       "2     20.8    90.0\n",
       "3     19.1    85.0\n",
       "4     17.4    80.0\n",
       "5     16.1    78.0\n",
       "6     14.8    76.0\n",
       "7     13.5    74.0\n",
       "8     12.2    72.0\n",
       "9     10.9    70.0\n",
       "10     9.6    68.0\n",
       "11     8.3    66.0\n",
       "12     7.0    64.0\n",
       "13     5.7    62.0\n",
       "14     4.4    60.0\n",
       "15     3.6    50.0\n",
       "16     2.8    40.0\n",
       "17     2.0    30.0\n",
       "18     1.2    20.0\n",
       "19     0.4    10.0"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_score[['女体前屈成绩','女体前屈分数']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "7b2ea6f0",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2['女体前屈分数'] = pd.cut(df2['女体前屈'],bins=[float('-inf') ]+list(df_score['女体前屈成绩'].sort_values())+[float('inf') ]\n",
    "                  ,right = False# 左闭右开\n",
    "                  ,labels=[0.0]+list(df_score['女体前屈分数'].sort_values())\n",
    "      )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "102e94dd",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "df2['女仰卧分数']=pd.cut(df2['女仰卧'],bins=[float('-inf') ]+list(df_score['女仰卧成绩'].sort_values())+[float('inf') ]\n",
    "           ,right = False# 左闭右开\n",
    "                  ,labels=[0.0]+list(df_score['女仰卧分数'].sort_values())\n",
    "      )\n",
    "                    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "dcd7ca70",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2['女肺活量分数'] = pd.cut(df2['女肺活量'],bins=[float('-inf') ]+list(df_score['女肺活量成绩'].sort_values())+[float('inf') ]\n",
    "                       ,right = False,# 左闭右开\n",
    "                  labels=[0.0]+list(df_score['女肺活量分数'].sort_values()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "3e39a8a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2['BMI']= df2[['体重','身高']].apply(lambda row: comput_bmi(row['体重'],row['身高']),axis=1).round(2) \n",
    "  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "49b7b03c",
   "metadata": {},
   "outputs": [],
   "source": [
    "new_columns1=['班级','性别','女800米跑','女800米跑分数','女50米跑','女50米跑分数','女跳远','女跳远分数','女体前屈','女体前屈分数','女仰卧','女仰卧分数','女肺活量','女肺活量分数','身高','体重','BMI']\n",
    "df2.reindex(columns=new_columns1).to_excel('./体测分数_女生.xls',encoding='utf-8')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b6b2fb13",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
